package model.race;

import java.util.ArrayList;
import java.util.List;

public class Race {
    private String date;
    private int id;
    private int numberOfParticipants;
    
    private List<Participant> participants = new ArrayList<Participant>();
    private List<Bet> bets = new ArrayList<Bet>();

    public Race(int id,String date,int numberOfParticipants) {
        this.id = id;
        this.date = date;
        this.numberOfParticipants = numberOfParticipants;
    }
    
    public void addParticipant(Participant participant) {
        participants.add(participant);
    }

    public List<Participant> getParticipants() {
        return participants;
    }
    
    public void addBet(Participant participant, double value) {
        bets.add(new Bet(id,participant.getId(),value));
        
    }

    @Override
    public String toString() {
        return String.format("%s %d",date,numberOfParticipants);
    }
}
